package com.wuyoucar.service;

import com.wuyoucar.common.ResultBean;
import com.wuyoucar.service.Impl.PersionCenterServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.ParseException;
import java.util.Map;

@Component
@FeignClient(value = "provider-PersionCenter",fallback = PersionCenterServiceImpl.class)
public interface PersionCenterService {

    //获取天气
    @RequestMapping("/weather/getWeather")
    public Map<Object,Object> getWeather();

    //绑定车辆
    @PostMapping("/bindcar/carinfo/{vin}/{carnumber}/{cartype}/{firstchecktime}/{seatamount}/{userid}")
    public ResultBean insertCarinfo(@PathVariable("vin") String vin,
                                    @PathVariable("carnumber") String carnumber,
                                    @PathVariable("cartype") String cartype,
                                    @PathVariable("firstchecktime") String firstchecktime,
                                    @PathVariable("seatamount") int seatamount,
                                    @PathVariable("userid") int userid) throws ParseException;

    //根据用户id 查询用户是否绑定车辆
    @GetMapping("/bindcar/checkbindcar/{userid}")
    public ResultBean selectAllCarById(@PathVariable("userid")Integer userid);

    //展示用户的个人信息
    @GetMapping("/tuser/showinfo/{userid}")
    public ResultBean queryOneById(@PathVariable("userid") Integer userid);

    //发送验证码
    @GetMapping("/tuser/getvcode/{newphone}")
    public ResultBean getVcode(@PathVariable("newphone")String newphone);

    @GetMapping("/tuser/updatepwd/{newpwd0}/{newpwd1}/{userid}")
    public ResultBean updatePwd(@PathVariable("newpwd0")String newpwd0,
                                @PathVariable("newpwd1")String newpwd1,
                                @PathVariable("userid")Integer userid
    );


    //借除绑定
    @GetMapping("/bindcar/unbunding/{vin}")
    public ResultBean unbunding(@PathVariable("vin")Integer vin);

    //查询理赔单
    @GetMapping("/tuser/mycliam/{userid}")
    public ResultBean selectreport(@PathVariable("userid")Integer userid);

    @GetMapping("/bank/selectAllBank/{userid}")
    public ResultBean selectAllBank(@PathVariable("userid") Integer userid);

    //绑定银行卡
    @GetMapping("/bank/bindCard/{userid}/{bankcard}")
    public ResultBean bindCard(@PathVariable("userid")Integer userid,
                               @PathVariable("bankcard")String bankcard);
}
